package com.nwpu.am.mapper;


import com.nwpu.am.pojo.entity.Rule;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;


@Mapper
public interface RuleMapper{
    @Select("SELECT * FROM tb_rule")
    ArrayList<Rule> selectAllRule();

    @Insert("INSERT INTO tb_rule (rule_id, premise_knowledge_id, conclusion_knowledge_id, probability) VALUES (#{ruleId}, #{premiseKnowledgeId},#{conclusionKnowledgeId}, #{probability})")
    int addRule(Rule rule);

    @Delete("DELETE FROM tb_rule WHERE rule_id = #{ruleId}")
    int deleteRule(long ruleId);

    @Select("SELECT * FROM tb_rule WHERE rule_id = #{ruleId}")
    Rule selectById(long ruleId);
}

